<script>
    class Person {
        // 构造器
        constructor(name, age) {  //隐式调用
            this.name = name;
            this.age = age;

            console.log("被调用了");
        }

        //添加公有
        say() {
            console.log(`${this.name}哈喽~~`);
        }

        hello() {
            console.log("hello~~~");
        }

    }

    class Student extends Person {

        constructor(name, age, xuehao) {  //constructor构造器,本质是一个函数，做初始化操作，默认会调用一次，例如：初始化一个人的信息，姓名，年龄...    
            super(name, age);  //必须写到this的前边， 主动去调用父类的constructor

            this.xuehao = xuehao;
        }

        xiezuoye() {
            console.log("写作业");
        }
    }

    let stu1 = new Student("张三", 100, "666");
    console.log(stu1);
</script>